using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class PeriodicGlow:MonoBehaviour {

	[SerializeField] float minGlowInterval;
	[SerializeField] float maxGlowInterval;
	[SerializeField] GameObject glowObject;

	float timeBeforeGlow;
	
	void Start() {
		ResetTimer();
	}
	void FixedUpdate() {
		timeBeforeGlow-=Time.deltaTime;
		if(timeBeforeGlow<=0){
			ParticleManager.Create(glowObject,transform.position);
			ResetTimer();
		}
	}

	void ResetTimer(){
		timeBeforeGlow=Random.Range(minGlowInterval,maxGlowInterval);
	}

}
